<?php

namespace app\common\model;

/**
 * [Companyhope  发愿表]
 * @author [C。]
 * @return html
 */
class CompanyHope extends Base
{
    protected $name = 'company_hope';
    /**
     * 根据搜索条件获取列表信息
     */
    public function getList($map, $from=0, $size = 5,$field='*')
    {
        $order = ['id' => 'desc'];

        $result =  $this->field($field)->where($map)
            ->limit($from, $size)
            ->order($order)
            ->select();

        return $result;
    }
    /**
     * 根据条件来获取列表的数据的总数
     * @param array $param
     */
    public function getCount($map = []) {
        return $this->where($map)->count();
    }
}